<%-- 
    Document   : ketquatimkiemphieugiaohang
    Created on : Oct 29, 2011, 1:04:22 PM
    Author     : phathuynh
--%>

<%@page import="hibernate.pojo.Sanpham"%>
<%@page import="hibernate.pojo.Dondathang"%>
<%@page import="hibernate.pojo.Chitietdondathang"%>
<%@page import="java.util.List"%>
<%@page import="hibernate.pojo.Khachhang"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Zing Deal | Thông tin khách hàng | Phiếu giao hàng</title>
        <link href="DealZing_files/6aad5646.css" rel="stylesheet" type="text/css" />
    </head>
    <%
        try 
        {
            Khachhang khachHang = (Khachhang) session.getAttribute("KhachHang");
            List<Chitietdondathang> lstPhieuGiaoHang = (List<Chitietdondathang>) request.getAttribute("KetQuaTimPhieuGiaoHang");
    %> 
    <body>

        <div id="subContent">
            <div id="subMainContent1">
                <div id="static"><div class="JsAjaxContent">
                        <div class="StaticTopPanel">
                            <h2 class="TitleMain">Phiếu giao hàng</h2>                                  
                        </div>
                        <!-- End .StaticTopPanel -->

                        <div class="OuterContent">
                            <div class="InnerContent">
                                <div class="StaticMain">
                                    <ul id="tabHeader">
                                        <li><a href="listdealboughtcontroller?action=listdealbought" title="Phiếu mua hàng"><span>Phiếu mua hàng</span></a></li>
                                        <li class="Active"><a href="listdealboughtcontroller?action=listdealdelivery" title="Phiếu giao hàng"><span>Phiếu giao hàng</span></a></li>
                                        <li><a href="listdealboughtcontroller?action=listdealtransactions" title="Lịch sử giao dịch"><span>Lịch sử giao dịch</span></a></li>
                                    </ul>                 
                                    <div class="ContentBlock">
                                        <form class="frmNapThe frmQLDH" id="DealUserTmpDeliveryindexForm" method="post" action="http://deal.zing.vn/tp-ho-chi-minh/deal_user_tmps/deliveryindex"><fieldset style="display:none;"><input type="hidden" name="_method" value="POST" /><input type="hidden" name="data[_Token][key]" value="9377ac733e255ab705e10fac0e866a374553cc9a" id="Token621784658" /></fieldset>                     
                                            <ul>
                                                <li>
                                                    <p>
                                                        <label for="maphieu" class="RegMaphieu">Ngày Mua</label>
                                                        <input type="text" name="ngaymua" class="date JsDateTime" readonly="readonly" />
                                                        <span class="JsDateTimeHide hide">
                                                            <select name="data[DealUserTmp][created][day]" id="DealUserTmpCreatedDay">
                                                                <option value="01">1</option>
                                                                <option value="02">2</option>
                                                                <option value="03">3</option>
                                                                <option value="04" selected="selected">4</option>
                                                                <option value="05">5</option>
                                                                <option value="06">6</option>
                                                                <option value="07">7</option>
                                                                <option value="08">8</option>
                                                                <option value="09">9</option>
                                                                <option value="10">10</option>
                                                                <option value="11">11</option>
                                                                <option value="12">12</option>
                                                                <option value="13">13</option>
                                                                <option value="14">14</option>
                                                                <option value="15">15</option>
                                                                <option value="16">16</option>
                                                                <option value="17">17</option>
                                                                <option value="18">18</option>
                                                                <option value="19">19</option>
                                                                <option value="20">20</option>
                                                                <option value="21">21</option>
                                                                <option value="22">22</option>
                                                                <option value="23">23</option>
                                                                <option value="24">24</option>
                                                                <option value="25">25</option>
                                                                <option value="26">26</option>
                                                                <option value="27">27</option>
                                                                <option value="28">28</option>
                                                                <option value="29">29</option>
                                                                <option value="30">30</option>
                                                                <option value="31">31</option>
                                                            </select>-<select name="data[DealUserTmp][created][month]" id="DealUserTmpCreatedMonth">
                                                                <option value="01">01</option>
                                                                <option value="02">02</option>
                                                                <option value="03">03</option>
                                                                <option value="04">04</option>
                                                                <option value="05">05</option>
                                                                <option value="06">06</option>
                                                                <option value="07">07</option>
                                                                <option value="08">08</option>
                                                                <option value="09">09</option>
                                                                <option value="10" selected="selected">10</option>
                                                                <option value="11">11</option>
                                                                <option value="12">12</option>
                                                            </select>-<select name="data[DealUserTmp][created][year]" id="DealUserTmpCreatedYear">
                                                                <option value="1991">1991</option>
                                                                <option value="1992">1992</option>
                                                                <option value="1993">1993</option>
                                                                <option value="1994">1994</option>
                                                                <option value="1995">1995</option>
                                                                <option value="1996">1996</option>
                                                                <option value="1997">1997</option>
                                                                <option value="1998">1998</option>
                                                                <option value="1999">1999</option>
                                                                <option value="2000">2000</option>
                                                                <option value="2001">2001</option>
                                                                <option value="2002">2002</option>
                                                                <option value="2003">2003</option>
                                                                <option value="2004">2004</option>
                                                                <option value="2005">2005</option>
                                                                <option value="2006">2006</option>
                                                                <option value="2007">2007</option>
                                                                <option value="2008">2008</option>
                                                                <option value="2009">2009</option>
                                                                <option value="2010">2010</option>
                                                                <option value="2011" selected="selected">2011</option>
                                                                <option value="2012">2012</option>
                                                                <option value="2013">2013</option>
                                                                <option value="2014">2014</option>
                                                                <option value="2015">2015</option>
                                                                <option value="2016">2016</option>
                                                                <option value="2017">2017</option>
                                                                <option value="2018">2018</option>
                                                                <option value="2019">2019</option>
                                                                <option value="2020">2020</option>
                                                                <option value="2021">2021</option>
                                                                <option value="2022">2022</option>
                                                                <option value="2023">2023</option>
                                                                <option value="2024">2024</option>
                                                                <option value="2025">2025</option>
                                                                <option value="2026">2026</option>
                                                                <option value="2027">2027</option>
                                                                <option value="2028">2028</option>
                                                                <option value="2029">2029</option>
                                                                <option value="2030">2030</option>
                                                                <option value="2031">2031</option>
                                                            </select>
                                                        </span>
                                                        <input type="submit" class="BtnTimMa" value="" style="width:60px; height: 23px; background:url(DealZing_files/tim-ma-small.png) no-repeat;"/>
                                                    </p>
                                                </li>                                              
                                            </ul>                     
                                            <fieldset style="display:none;"><input type="hidden" name="data[_Token][fields]" value="8ca4405f1e2d829fe5ff2ac1e6496b2ee1969bcc%3An%3A0%3A%7B%7D" id="TokenFields1262639613" /></fieldset></form>                   

                                        <table width="100%" cellspacing="0" cellpadding="0" class="MyTable MyTableQLDH">
                                            <thead>
                                                <tr>
                                                    <th>Ngày Mua</th>                         
                                                    <th>Deal</th>
                                                    <th>Số lượng</th>
                                                    <th>Giá Mua</th>
                                                    <th>Trạng thái</th>
                                                </tr>
                                            </thead>
                                            <!-- phieu giao hang -->
                                            <%
                                                for (int i = 0; i < lstPhieuGiaoHang.size(); i++) {
                                                    Chitietdondathang ctddh = lstPhieuGiaoHang.get(i);
                                                    Dondathang dondh = ctddh.getDondathang();
                                                    Sanpham sanpham = ctddh.getSanpham();
                                                    String strTinhTrangGiaoHang = "";
                                                    if (dondh.getTrangThaiXacNhan() == -1) 
                                                    {
                                                        strTinhTrangGiaoHang = "Hủy đơn hàng";
                                                    } 
                                                    else if(dondh.getTrangThaiXacNhan()==0)
                                                    {
                                                        strTinhTrangGiaoHang = "Đã xác nhận<a href='cancelordercontroller?action=cancelorder&amp;maDonDatHang="+dondh.getMaDonDatHang()+"' title='Hủy đơn hàng' class='vtip'><img src='DealZing_files/icon-del.png' alt='' /></a>";
                                                    }
                                                    else if(dondh.getTrangThaiXacNhan()==1)
                                                    {
                                                        strTinhTrangGiaoHang = "Đã xác nhận";
                                                    }
                                            %>
                                            <tbody>
                                                <%if (i % 2 == 0) {%>
                                                <tr class="OddRow">
                                                    <td class="HorzCenter"><span class="c" title="<%=dondh.getNgayDat()%>"><%=dondh.getNgayDat()%></span></td>                          
                                                    <td class="HorzLeft"><a href="dealdetailcontroller?action=viewdealdetail&amp;state=opening&amp;maSanPham=<%=sanpham.getMaSanPham()%>" title="<%=sanpham.getTieuDeSanPham()%>"><%=sanpham.getTenSanPham()%></a></td>
                                                    <td class="HorzCenter"><span class="c" title=""><%=ctddh.getSoLuongDat()%></span></td>
                                                    <td class="HorzCenter"><%=ctddh.getDonGiaBan()%></td>
                                                    <td class="HorzLeft"><%=strTinhTrangGiaoHang%></td>						  
                                                </tr>	
                                                <%} else {%>
                                                <tr class="EvenRow">
                                                    <td class="HorzCenter"><span class="c" title="<%=dondh.getNgayDat()%>"><%=dondh.getNgayDat()%></span></td>                          
                                                    <td class="HorzLeft"><a href="dealdetailcontroller?action=viewdealdetail&amp;state=opening&amp;maSanPham=<%=sanpham.getMaSanPham()%>" title="<%=sanpham.getTieuDeSanPham()%>"><%=sanpham.getTenSanPham()%></a></td>
                                                    <td class="HorzCenter"><span class="c" title=""><%=ctddh.getSoLuongDat()%></span></td>
                                                    <td class="HorzCenter"><%=ctddh.getDonGiaBan()%></td>
                                                    <td class="HorzLeft"><%=strTinhTrangGiaoHang%></td>						  
                                                </tr>
                                                <%}%>
                                            </tbody>
                                            <%}%>
                                        </table>
                                        <div class="PagingWrapper">
                                            <div class="PageControl">
                                                <ul class="PageList">
                                                    <span class="PagingFirstPageLnk">&laquo; Trước</span>
                                                    <span class="PagingNextPageLnk">Tiếp theo &raquo;</span>
                                                </ul>
                                            </div>
                                        </div>						
                                        <div class="NoticeBox">
                                            <p class="Legend LegendQLDH">Ghi chú</p>
                                            <div class="NoteContent">
                                                <ul class="Dash">
                                                    <li><strong>Đã xác nhận:</strong> Đơn hàng đã được user xác nhận qua Email hoặc SMS</li>
                                                    <li><strong>Chờ xác nhận từ Zing Deal:</strong> Đơn hàng đang chờ xác nhận từ Zing Deal</li>
                                                    <li><strong>Chờ giao phiếu:</strong> Đơn hàng đang trên đường giao</li>                          
                                                    <li><strong>Đã giao phiếu:</strong> Đơn hàng đã được giao</li>						
                                                </ul>
                                            </div>                                     
                                        </div>
                                    </div>
                                    <!-- End .ContentBlock -->
                                </div>
                                <!-- End .StaticMain -->
                            </div>
                            <!-- End .InnerContent -->
                        </div>
                        <!-- End .OuterContent -->
                    </div></div>
                <!-- End #static -->
                <div class="botSubContent1"></div>
            </div>

            <!-- End #subMainContent1 -->

        </div>
    </body>
    <%
        } catch (Exception ex) {
            System.err.print(ex);
        }
    %>
</html>
